#pragma once
#include<iostream>
#include<vector>
#include "_LDIF.h"
using namespace std;

#ifndef ATRIBUT
#define ATRIBUT
#include"Atribut.cpp"
#endif

/////pentru timpul cautarii si numarul de intrari returnare--size limit....


#define MAXTIMELIMIT 65000
#define MAXSIZELIMIT 100

enum timelimit{

	NO_LIMIT = 0,

	LIMIT_SET,

	MAX_LIMIT 
};

enum sizelimit{

	NO_SIZE_LIMIT = 0,

	SIZE_LIMIT ,

	MAX_SIZE_LIMIT
};


/////pentru modul de stabilire a autentificarii....simpla sau folosind SALS..optiunea
//-x din comanda

enum authentication_type{

	SIMPLE_AUTH = 0,

	SASL_AUTH
};


class LDAP_Operation
{
protected:
	char *result;
	char *DN;
	authentication_type auth_type;

	char* Ldap_URI;
	char *Ldap_OPTIONS;
	char **option;
	int nr_opt;


	vector<Atribut<char*>> atribute;
public:
	LDAP_Operation(char *dn,vector<Atribut<char*>> atribute);//+vector de atribute


	LDAP_Operation(void);

	LDAP_Operation(char *dn,int auth_type,char **optiuni,int nr_opt,vector<Atribut<char*>> atr);

	LDAP_Operation(char *dn,int auth_type,char *ldap_URI,char **option,int nr_opt);

	LDAP_Operation(char *,int ,char *,char *);

	LDAP_Operation(char *);

	LDAP_Operation(char *dn,int auth,char **opt,int nr);

	LDAP_Operation(const LDAP_Operation& op);

	LDAP_Operation& operator=(const LDAP_Operation& op);

	virtual ~LDAP_Operation(void);

	virtual LDAP_Operation* operate()=0;
	//returneaza LDAP_Operation pentru a putea pune operatiile intr-o coada de asteptare
	//in cazul in care apare o problema cu serverul sau cu clientul,
	//urmand ca executarea operatiilor sa se reia din punctul in care ramasese

	char* daResult()const;

	char* getDN()const;

	vector<Atribut<char*>> getAtribute()const;

	void addAtribut(Atribut<char*> atribut);

	void addAtribute(vector<Atribut<char*>> atribute);
};

